<h2><?php  __('Manage module: '.$cdeModule['CdeModule']['title']);?></h2>
<p><?php echo $cdeModule['CdeModule']['description']; ?><p>

<h3>Reference links</h3>
<p><?php echo $cdeModule['CdeModule']['introduction']; ?></p>
<div>
<table class="list">
<tr>
	<th>Link display</th>
	<th>Link URL</th>
	<th class="actions"><?php __('Actions');?>&nbsp;|&nbsp;<?php echo $html->link(__('Add new reference link', true), array('action'=>'../cde_referencelinks/add', $cdeModule['CdeModule']['id'])); ?></th>
</tr>
<?php
$i = 0;
foreach ($cdeReferencelinks as $cdeReferencelink):
	$class = null;
	if ($i++ % 2 == 1) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $cdeReferencelink['CdeReferencelink']['display']; ?>
		</td>
		<td>
			<?php echo $cdeReferencelink['CdeReferencelink']['url']; ?>
		</td>
		<td class="actions">
			<?php echo $html->link(__('Update', true), array('action'=>'../cde_referencelinks/edit', $cdeReferencelink['CdeReferencelink']['id'])); ?>&nbsp;&nbsp;|&nbsp;&nbsp;
			<?php echo $html->link(__('Delete', true), array('action'=>'../cde_referencelinks/delete', $cdeReferencelink['CdeReferencelink']['id']), null, sprintf(__('Are you sure you want to delete reference link "%s"?', true), $cdeReferencelink['CdeReferencelink']['display'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>

<h3>Answers</h3>
<p><?php echo $cdeModule['CdeModule']['question']; ?></p>
<table class="list">
<tr>
	<th>Answer content</th>
	<th class="checkbox">Correct</th>
	<th class="checkbox">Enabled</th>
	<th class="actions"><?php __('Actions');?>&nbsp;|&nbsp;<?php echo $html->link(__('Add new answer', true), array('action'=>'../cde_answers/add', $cdeModule['CdeModule']['id'])); ?></th>
</tr>
<?php
$i = 0;
foreach ($cdeAnswers as $cdeAnswer):
	$class = null;
	if ($i++ % 2 == 1) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $cdeAnswer['CdeAnswer']['answercontent']; ?>
		</td>
		<td class="checkbox">
			<input type="checkbox" <?php if ($cdeAnswer['CdeAnswer']['correct']) echo "checked='checked'"; ?> disabled='disabled' />
		</td>
		<td class="checkbox">
			<input type="checkbox" <?php if ($cdeAnswer['CdeAnswer']['enabled']) echo "checked='checked'"; ?> disabled='disabled' />
		</td>
		<td class="actions">
			<?php echo $html->link(__('Update', true), array('action'=>'../cde_answers/edit', $cdeAnswer['CdeAnswer']['id'])); ?>&nbsp;&nbsp;|&nbsp;&nbsp;
			<?php echo $html->link(__('Delete', true), array('action'=>'../cde_answers/delete', $cdeAnswer['CdeAnswer']['id']), null, sprintf(__('Are you sure you want to delete answer "%s"?', true), $cdeAnswer['CdeAnswer']['answercontent'])); ?>&nbsp;&nbsp;|&nbsp;&nbsp;
			<?php
				if ($cdeAnswer['CdeAnswer']['enabled'])
				{
					echo $html->link(__('Disable', true), array('action'=>'../cde_answers/disable', $cdeAnswer['CdeAnswer']['id']));
				}
				else
				{
					echo $html->link(__('Enable', true), array('action'=>'../cde_answers/enable', $cdeAnswer['CdeAnswer']['id']));
				}
			?>
		</td>
	</tr>
<?php endforeach; ?>
</table>

<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Back to Manage unit', true), array('action'=>'../cde_units/manage/'.$cdeModule['CdeModule']['cde_unit_id'])); ?> </li>
	</ul>
</div>
